<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>声明式声明类并继承</title>
</head>

<body>

</body>
<script>
  "use strict"; {
    let father = class {
      constructor(x, y) {
        this.x = x;
        this.y = y;
      }
      sing() {
        console.log(`我是父类`);
      }
    };
    let son = class extends father {
      constructor(x, y) {
        // 使用了extends 在constructor 里面必须的要用到super
        super(x, y);
        this.x = x;
        this.y = y;
      }
      say() {
        console.log(`我是子类`);
      }
    };
    let aa = new father();
    let bb = new son();
    bb.sing();
    bb.say();
  };
</script>

</html>